/*
 * @Author: leonard
 * @Date: 2024-12-31 22:37:48
 * @LastEditors: leonard 1287279970@qq.com
 * @LastEditTime: 2025-01-01 20:25:52
 * @FilePath: /amap-admin/src/pages/Sensor/index.jsx
 * @Description:
 *
 * Copyright (c) 2025 by flyray Technology CO., Ltd, All Rights Reserved.
 */
import React, { useState, useEffect } from "react";
import { Row, Col, Card, Table, Badge, Statistic } from "antd";
import {
  Map,
  APILoader,
  InfoWindow,
  ScaleControl,
  ToolBarControl,
  ControlBarControl,
  Geolocation,
  Marker,
} from "@uiw/react-amap";
import {
  CloudOutlined,
  EnvironmentOutlined,
  DashboardOutlined,
} from "@ant-design/icons";
import MapMarker from "../../component/MapMarker";
import config from "../../config/config";
import "./style.less";

const Sensor = () => {
  // 模拟传感器数据
  const [sensors, setSensors] = useState([
    {
      id: 1,
      name: "传感器-01",
      position: [120.1551, 30.2539],
      temperature: 25.6,
      humidity: 65,
      online: true,
    },
    {
      id: 2,
      name: "传感器-02",
      position: [120.1601, 30.2579],
      temperature: 26.2,
      humidity: 62,
      online: false,
    },
  ]); 
  
  return (
    <div>
      <APILoader {...config.mapConfig}>
        <MapMarker sensors={sensors} />
      </APILoader>
    </div>
  );
};

export default Sensor;
